import { createApp } from "vue";
import { createPinia } from "pinia";
import piniaPersist from "pinia-plugin-persist-uni";

// elmentui
import "element-plus/theme-chalk/el-loading.css";
import "element-plus/theme-chalk/el-message.css";
import "element-plus/theme-chalk/el-notification.css";
import "element-plus/theme-chalk/el-message-box.css";

import "tailwindcss/tailwind.css";
// normalize.css
import "normalize.css/normalize.css";
// 全局样式
import "./styles/index.less";
// tailwindcss
import "./styles/tailwind.css";
// svg icon
import "virtual:svg-icons-register";
//蒙版组件
import mongolianlayer from "../src/components/login/mongolianlayer.vue";
import lightreminder from "../src/components/login/lightreminder.vue";
import close from "../src/components/bank/close.vue";
//国际化
import i18n from "@/lang/index.js";
//懒加载
import { Lazyload } from "vant";
//自定义组件
import Directives from "./directives/index";

import App from "./App.vue";
import router from "./router";
import loadingGif from "../src/assets/loading.gif";

// 去掉控制台打印
if (process.env.NODE_ENV === 'production') {
  console.log = () => { };
  console.error = () => { };
}

const app = createApp(App);

const pinia = createPinia();
pinia.use(piniaPersist);

// app.use(store);
// 使用全局自定义指令
app.use(pinia);
app.use(Directives);
app.use(router);
app.use(i18n);
// 注册时可以配置额外的选项
app.use(Lazyload, {
  lazyComponent: true,
  loading: loadingGif
});
app.component("lightreminder", lightreminder);
app.component("mongolianlayer", mongolianlayer);
app.component("close", close);
app.mount("#app");
